package com.lanou3g.hw0420.a4;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * Created by dllo on 18/4/21.
 */
public class Server {
    public static void main(String[] args) {
        try {
            ServerSocket ss = new ServerSocket(2333);
            System.out.println("服务器已启动,等待连接");
            while (true) {
                Socket client = ss.accept();
                System.out.println("有一个客户端接入:" + client.getRemoteSocketAddress());
                new EchoTread(client).start();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
